//
//  MCDietHealthCollectionCell.swift
//  MCBodyBuildingPro
//
//  Created by Renlvshijie on 2023/5/5.
//

import UIKit
import SnapKit
import QMUIKit

class MCDietHealthCollectionCell: UICollectionViewCell {
    
    
    
    var kcalInfoLabel:QMUILabel!
    var titleInfoLabel:QMUILabel!
    var collectionInfoBtn:QMUIButton!
    var icImageView:UIImageView!
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        loadSubView()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    func loadSubView() -> Void {
        
        
        let kcalLabel = QMUILabel.init()
        kcalLabel.text = "约等于1025kcal"
        self.kcalInfoLabel = kcalLabel
        kcalLabel.font = UIFont.systemFont(ofSize: 15)
        kcalLabel.textColor = UIColor.qmui_color(withHexString: "#333333")
        self.contentView.addSubview(kcalLabel)
        kcalLabel.snp.makeConstraints { make in
            make.left.equalTo(self.contentView.snp.left).offset(0.0)
            make.bottom.equalTo(self.contentView.snp.bottom).offset(0.0)
        }
        
        
        //文字
        let titleLabel = QMUILabel.init()
        self.titleInfoLabel = titleLabel
        let collectBtn = QMUIButton.init()
        collectBtn.setImage(UIImage(named: "common_blue_image"), for: .normal)
        self.contentView.addSubview(collectBtn)
        
        titleLabel.text = "牛肉洋葱减脂沙拉得到的"
        titleLabel.font = UIFont.systemFont(ofSize: 15)
        titleLabel.textColor = UIColor.qmui_color(withHexString: "#333333")
        self.contentView.addSubview(titleLabel)
        titleLabel.snp.makeConstraints { make in
            make.left.equalTo(self.contentView.snp.left).offset(0.0)
            make.bottom.equalTo(kcalLabel.snp.top).offset(0.0)
            make.right.equalTo(collectBtn.snp.left).offset(-10.0)
        }
        
        collectBtn.snp.makeConstraints { make in
            make.right.equalTo(self.contentView.snp.right).offset(-10)
            make.centerY.equalTo(titleLabel.snp.centerY).offset(0.0)
            make.size.equalTo(CGSize(width: 30, height: 30))
        }
        
        self.collectionInfoBtn = collectBtn
        
        
        //图
        let iconImageView = UIImageView.init()
        iconImageView.image = UIImage(named: "common_blue_image")
        self.contentView.addSubview(iconImageView)
        iconImageView.snp.makeConstraints { make in
            make.left.equalTo(self.contentView.snp.left).offset(0.0)
            make.right.equalTo(self.contentView.snp.right).offset(0.0)
            make.top.equalTo(self.contentView.snp.top).offset(0.0)
            make.bottom.equalTo(titleLabel.snp.top).offset(-5)
        }
        
        self.icImageView = iconImageView
        
    }
}
